package com.googlecode.nls4j;

import java.util.Locale;

/**
 * NlsBundle is a collection of locale-sensitive resources of type <b>V</b>
 * which identified by {@link NlsKey}s of type <b>K</b>.
 * 
 * @param <K>
 *            type of the resources identifier.
 * @param <V>
 *            type of the resources this bundle contains.
 * @author Andrey Pavlenko
 */
public interface NlsBundle<K extends NlsKey<V>, V> {

    /**
     * Returns the resource identified by the specified key. If the resource is
     * not found, this method returns the value provided by the
     * {@link NlsKey#getDefaultValue(Locale)} method for the locale associated
     * with this bundle.
     * 
     * @throws NullPointerException
     *             if the key is null.
     */
    public V get(K key) throws NullPointerException;

    /**
     * Returns true if this bundle contains a resource identified by the the
     * specified key.
     * 
     * @throws NullPointerException
     *             if the key is null.
     */
    public boolean contains(K key);

    /**
     * Returns the locale associated with this bundle.
     */
    public Locale getLocale();
}
